package com.ssy.lingxi.product.service.customer;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.product.api.model.request.CustomerCategoryAttributeRequest;
import com.ssy.lingxi.product.api.model.request.CustomerCategoryAttributeSortRequest;
import com.ssy.lingxi.product.entity.customer.CustomerAttribute;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 品类属性管理类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/22
 */
public interface ICustomerCategoryAttributeService {

    /**
     * 查询属性
     * @param pageVO
     * @param name
     * @param categoryId
     * @param isByCategory
     * @return Wrapper<?>
     */
    Page<CustomerAttribute> getCustomerCategoryAttributeList(UserLoginCacheDTO sysUser, PageVO pageVO, String name, String groupName, Long categoryId, Boolean isByCategory);

    /**
     * 获取当前品类的子品类id 包含本品类id
     *
     * @param categoryId
     * @return
     */
    List<Long> getSubCategoryIdList(Long categoryId);

    /**
     * 添加/修改品类
     * @param customerCategoryAttributeVO
     * @return
     */
    String saveCustomerCategoryAttribute(UserLoginCacheDTO sysUser, CustomerCategoryAttributeRequest customerCategoryAttributeVO);

    /**
     * 删除品类属性
     * @param customerCategoryAttributeVO
     * @return
     */
    String deleteCustomerCategoryAttribute(UserLoginCacheDTO sysUser, CustomerCategoryAttributeRequest customerCategoryAttributeVO);

    /***
     * 新增/修改品类下的属性排序
     * @param sysUser
     * @param customerCategoryAttributeSortRequestList
     * @return
     */
    Boolean saveCustomerCategoryAttributeSort(UserLoginCacheDTO sysUser, List<CustomerCategoryAttributeSortRequest> customerCategoryAttributeSortRequestList);

    /**
     * 查询属性-MRO模式 按照特定的排序返回结果
     * @param sysUser
     * @param name
     * @param groupName
     * @param categoryId
     * @param isByCategory
     * @return
     */
    List<CustomerAttribute> getMroCustomerCategoryAttributeList(UserLoginCacheDTO sysUser, String name, String groupName, Long categoryId, Boolean isByCategory);

    /**
     * 初始化排序
     * @return
     */
//    Boolean initSortCache();

}
